<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>xiarikui管理后台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <link href="/Public/Admin/css/unify.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/Public/images/favicon.ico" type="image/x-icon" />
    <script src="/Public/js/jQuery-2.1.4.min.js"></script>
    <script src="/Public/js/global.js"></script>
    <script src="/Public/js/myFormValidate.js"></script>
    <script src="/Public/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/Public/js/layer/layer-min.js"></script>
    <script src="/Public/js/myAjax.js"></script>
    <script type="text/javascript">
    function delfunc(obj) {
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: $(obj).attr('data-id')
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $(obj).parent().parent().remove();
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }

    //全选
    function selectAll(name, obj) {
        $('input[name*=' + name + ']').prop('checked', $(obj).checked);
    }

    function get_help(obj) {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: 0.3,
            area: ['90%', '90%'],
            content: $(obj).attr('data-url')
        });
    }

    function delAll(obj, name) {
        var a = [];
        $('input[name*=' + name + ']').each(function(i, o) {
            if ($(o).is(':checked')) {
                a.push($(o).val());
            }
        });
        if (a.length == 0) {
            layer.alert('请选择删除项', {
                icon: 2
            });
            return;
        }
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'get',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: a
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $('input[name*=' + name + ']').each(function(i, o) {
                            if ($(o).is(':checked')) {
                                $(o).parent().parent().remove();
                            }
                        });
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }
    </script>
    <style type="text/css">
        .table > thead:first-child > tr:first-child > th{
            border-bottom: 0 none;
        } 
    </style>
</head>

<body>

<link href="/Public/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="/Public/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="/Public/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <div class="breadcrumbs" id="breadcrumbs">
    <ol class="breadcrumb">
        <?php if(is_array($navigate_admin)): foreach($navigate_admin as $k=>$v): ?><li><?php echo ($k); ?></li><?php endforeach; endif; ?>
    </ol>
</div>

    <section class="content" style="padding:0px 15px;">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-body ">
                    <ul class="nav nav-tabs">
                        <?php if(is_array($groupList)): foreach($groupList as $k=>$vo): ?><li <?php if($k == 'basic'): ?>class="active"<?php endif; ?>><a href="javascript:;" data-url="<?php echo U('System/index',array('inc_type'=>$k));?>" data-toggle="tab" onclick="goset(this)"><?php echo ($vo); ?></a></li><?php endforeach; endif; ?>
                    </ul>
                    <form method="post" id="handlepost" action="<?php echo U('System/handle');?>">

                        <div class="tab-content" style="padding:20px 0px;">
                            <div class="tab-pane active" id="tab_tongyong">
                                <table class="table table-bordered">
                                    <tbody>

                                        <tr>
                                            <td class = "align-right">首页热门搜索词：</td>
                                            <td colspan="2">
                                                <input type="text" class="form-control" name="hot_keywords" value="<?php echo ($config["hot_keywords"]); ?>">
                                                <p class="text-warning txt-info">多个热门搜索关键词请用竖线|分开，如(手机|电脑)</p>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">过期不响应分配给：</td>
                                            <td>
                                                <select name="accountant_head" class="form-control">
                                                <?php if(is_array($accountant_list)): $i = 0; $__LIST__ = $accountant_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["au_id"]); ?>" <?php if($vo[au_id] == $config[accountant_head]): ?>selected<?php endif; ?>><?php echo ($vo["username"]); ?>[<?php echo ($vo["mobile"]); ?>]</option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                </select>
                                            </td>
                                            <td></td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">悬赏金额：</td>
                                            <td>
                                                <input type="text"  title="悬赏金额" class="form-control" name="reward_str" value="<?php echo ($config["reward_str"]); ?>">
                                            </td>
                                            <td>使用英文状态下的逗号分割，单位元</td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">打赏金额：</td>
                                            <td>
                                                <input type="text"  title="打赏金额" class="form-control" name="bonus_str" value="<?php echo ($config["bonus_str"]); ?>">
                                            </td>
                                            <td>使用英文状态下的逗号分割，单位元</td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">一般回答时间：</td>
                                            <td>
                                                <input type="text"  title="一般回答时间" class="input-sm" name="normal_hour" value="<?php echo ($config["normal_hour"]); ?>">
                                            </td>
                                            <td>单位：小时</td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">悬赏回答时间：</td>
                                            <td>
                                                <input type="text"  title="悬赏回答时间" class="input-sm" name="speed_hour" value="<?php echo ($config["speed_hour"]); ?>">
                                            </td>
                                            <td>单位：小时</td>
                                        </tr>

                                        <!--<tr>-->
                                            <!--<td class = "align-right">会计收入分成：</td>-->
                                            <!--<td>-->
                                                <!--<input type="text"  title="会计收入分成" class="input-sm" name="accountant_rates" value="<?php echo ($config["accountant_rate"]); ?>">%-->
                                            <!--</td>-->
                                            <!--<td></td>-->
                                        <!--</tr>-->

                                        <!--<tr>-->
                                            <!--<td class = "align-right">平台收入分成：</td>-->
                                            <!--<td>-->
                                                <!--<input type="text"  title="平台收入分成" class="input-sm" name="platform_rate" value="<?php echo ($config["platform_rate"]); ?>">%-->
                                            <!--</td>-->
                                            <!--<td></td>-->
                                        <!--</tr>-->

                                        <tr>
                                            <td class = "align-right">年费金额：</td>
                                            <td>
                                                <input type="text"  title="年费金额" class="input-sm" name="year_money" value="<?php echo ($config["year_money"]); ?>">
                                            </td>
                                            <td>单位：元</td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">试用期月份数：</td>
                                            <td>
                                                <input type="text"  title="试用期月份" class="input-sm" name="test_month" value="<?php echo ($config["test_month"]); ?>">
                                            </td>
                                            <td>填入多少个月</td>
                                        </tr>

                                        <tr>
                                            <td class = "align-right">满期提示天数：</td>
                                            <td>
                                                <input type="text"  title="满期提示天数" class="input-sm" name="prompt_day" value="<?php echo ($config["prompt_day"]); ?>">
                                            </td>
                                            <td>填入多少天</td>
                                        </tr>

                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td>
                                                <input type="hidden" name="inc_type" value="<?php echo ($inc_type); ?>">
                                            </td>
                                            <td></td>
                                            <td class="text-right">
                                                <input class="btn btn-primary" type="button" onclick="adsubmit()" value="保存">
                                            </td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    function adsubmit() {
        $('#handlepost').submit();
    }

    $(document).ready(function () {
        get_province();
    });

    function goset(obj) {
        window.location.href = $(obj).attr('data-url');
    }
</script>
</body>

</html>